package world.criver.h50529.module;

import world.criver.h50529.enums.enumComType;

import java.util.ArrayList;

public class moGroupItem {
    private String name="";

    private String type="TCP";

    /*
     * TCP/DUP
     */
    private String ip;
    private int port;
    /*
     * COM3
     */
    private String serial;
    private int baud_rate;
    private int num_data_bit;
    private float num_stop_bit;
    private String parity;
    /*
     * WOL
     */
    private String mac;

    private ArrayList<moGroupEvent> commands=new ArrayList<>();

    public String toString(){
        if(type.equals(enumComType.com3.name().toUpperCase()))return "串口:"+serial+" 波特率:"+baud_rate+" 数据位:"+num_data_bit+" 停止位:"+num_stop_bit+" 校验位:"+parity;
        else if(type.equals(enumComType.wol.name().toUpperCase()))return "MAC:"+mac;
        else return type+" "+"ip:"+ip+" port:"+port;
    }

    public ArrayList<moGroupEvent> getCommands() {
        return commands;
    }

    public void setCommands(ArrayList<moGroupEvent> commands) {
        this.commands = commands;
    }

    public int getPort() {
        return port;
    }

    public void setPort(int port) {
        this.port = port;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getSerial() {
        return serial;
    }

    public void setSerial(String serial) {
        this.serial = serial;
    }

    public int getBaud_rate() {
        return baud_rate;
    }

    public void setBaud_rate(int baud_rate) {
        this.baud_rate = baud_rate;
    }

    public int getNum_data_bit() {
        return num_data_bit;
    }

    public void setNum_data_bit(int num_data_bit) {
        this.num_data_bit = num_data_bit;
    }

    public float getNum_stop_bit() {
        return num_stop_bit;
    }

    public void setNum_stop_bit(float num_stop_bit) {
        this.num_stop_bit = num_stop_bit;
    }

    public String getParity() {
        return parity;
    }

    public void setParity(String parity) {
        this.parity = parity;
    }

    public String getMac() {
        return mac;
    }

    public void setMac(String mac) {
        this.mac = mac;
    }
}
